﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
using Entity.IRepository.Project;
using Entity.ProjectEnt;
using ZFine.Data;

namespace Logic.Repository.Project
{
    public class HistoryGudaoCarRepository : RepositoryBase<HistoryGudaoCarEntity>,IHistoryGudaoCarRepository
    {
        public List<HistoryGudaoCarEntity> FindList(Expression<Func<HistoryGudaoCarEntity, bool>> predicate)
        {
            return dbcontext.Set<HistoryGudaoCarEntity>().Include(f => f.BelongPathway).Include(f => f.BelongCarriage).Include(f => f.Operation).Include(f => f.PassOper).Include(f => f.QiPiaoOper).Include(f => f.ClearGudaoOper).Include(f => f.WorkPlanOper).Include(f => f.DuiWeiOper).Include(f => f.RecoveryOper).Where(predicate).ToList();
        }

        /// <summary>
        /// 回退排车用
        /// </summary>
        /// <param name="predicate"></param>
        /// <returns></returns>
        public List<HistoryGudaoCarEntity> FindListBelongandClera(
            Expression<Func<HistoryGudaoCarEntity, bool>> predicate)
        {
            return dbcontext.Set<HistoryGudaoCarEntity>().Include(f => f.BelongCarriage).Include(f => f.ClearGudaoOper).Where(predicate).ToList();
        }
    }
}
